package org.intelli.dl.learn.order.feign.fallback;

import org.intelli.dl.learn.model.product.Product;
import org.intelli.dl.learn.order.feign.ProductFeignClient;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * @author: Michael
 * @date: 2025/4/21
 * @desc:
 */
@Component
public class ProductFeignClientFallback implements ProductFeignClient {

    @Override
    public Product getProductById(Long productId) {
        System.out.println("兜底回调");
        Product product = new Product();
        product.setId(productId);
        product.setProductName("未知商品");
        product.setPrice(new BigDecimal(0));
        product.setNum(0);
        return product;
    }

}
